﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		
		<title>jb-aptech毕业设计项目</TITLE>
<meta name="renderer" content="ie-comp">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link href="../../css/style.css" rel="stylesheet" type="text/css">
		<script src="../../script/common.js"></script>
		<script src="../../script/validate.js"></script>
		<script src="../../js/vue.js"></script>
		<script src="../../js/jquery/jquery-1.5.2.min.js"></script>
<link rel="stylesheet" type="text/css" href="ExtJS/resources/css/ext-all.css">
<script type="text/javascript" src="ExtJS/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ExtJS/ext-all.js"></script>
	</head>
	<script type="text/javascript">
		function myAdd(){
			document.sysRightForm.submit();
		}
	</script>
	<body>
	<div id="app">
		<div class="page_title">
			权限管理 > 权限管理 > 权限查询
		</div>
		

			
			<div class="button_bar">
				<button class="common_button" onclick="help('');">
					帮助
				</button>  
				<button class="common_button" onclick="myAdd();">
					查询
				</button>
			</div>
			<table class="query_form_table">
				<tr>
					<th>
						权限文本
					</th>
					<td>
						<input type="text" v-model="sums.right_text" value="">
					</td>
					<th>
						权限描述
					</th>
					<td>
						<input type="text" v-model="sums.right_tip" value="">
					</td>
					<th>
						权限类型
					</th>
					<td>
						<select name="sysRight.rightType" v-model="sums.right_icon">
							<option value="">--请选择父节点--</option>

							<option value="Folder">Folder</option>
							<option value="Document">Document</option>


						</select>
					</td>
					<td><button @click="load()">查询</button></td>
				</tr>
			</table>
			<br />
			<table class="query_form_table">
				<tr>
					<th>
						权限编号
					</th>
					<th>
						权限文本
					</th>
					<th>
						权限父节点
					</th>
					<th>
						权限类型
					</th>
					<th>
						权限描述
					</th>
					<th>
						权限操作
					</th>
				</tr>
				
					<tr v-for="m in sum">
						<td v-text="m.right_code">
							
						</td>
						<td v-text="m.right_text">
							
						</td>
						<td v-text="m.right_url">
							L06
						</td>
						<td v-text="m.right_icon">
							Document
						</td>
						<td v-text="m.right_tip">
							
						</td>
						<td>
							<img
									@click="up(m.right_code)"
                                    title="编辑" src="../../images/bt_edit.gif" class="op_button" />
							<img
									@click="show(m.right_code)"
                                    title="查看" src="../../images/bt_deal.gif" class="op_button" />
							<img
									@click="del(m.right_code)"
                                    title="删除" src="../../images/bt_del.gif" class="op_button" />
						</td>
				<tr>
					<th colspan="7" class="pager">
						<div>
							<div class="row">
								<div class="mx-auto" id="lin">
									<!--                <a href="javascript:;" @click="emp.pageNum=pageInfo.pageNum-1;load()">上一页</a>-->
									<!--                <a href="javascript:;" @click="emp.pageNum=pageInfo.pageNum+1;load()">下一页</a>-->
									<ul class="pagination">
										<li class="page-item" :class="{'disabled':pageInfo.isFirstPage}"><a class="page-link" href="#" @click.capture="sums.pageNum=pageInfo.pageNum-1;load()">上一页</a></li>

										<li class="page-item"  :class="{'active':p==pageInfo.pageNum}"  v-for="p in pageInfo.navigatepageNums">
											<a class="page-link" href="#" @click.capture="sums.pageNum=p;load()">{{p}}</a></li>

										<li class="page-item" :class="{'disabled':pageInfo.isLastPage}"><a class="page-link" href="#" @click.capture="sums.pageNum=pageInfo.pageNum+1;load()">下一页</a></li>
									</ul>
								</div>
							</div>
						</div>
					</th>
				</tr>
					</tr>




			</table>

	</div>
	</body>
	<script>
		const  app=new Vue({
			el:"#app",
			data:{
				sum:[],
				sums:{
					right_text:"",
					right_icon:"",
					right_tip:"",
					pageSize:4,
					pageNum:1,
				},
			},methods:{
				load(){
					$.getJSON("/SysMight/queryPage",this.sums,json=>{
						this.pageInfo=json.data.pageInfo;
						this.sum=json.data.pageInfo.list;
					});
				},del(id){
					$.post("/SysMight/delById/"+id,json=>{
						if (json.message == "OK") {
							alert("删除成功");
							location.href = "list.html";
						} else {
							alert("删除失败");
							location.href = "list.html";
						}
					})
				},up(id){
					location="edit.html?right_code="+id;
				},show(id){
					location="detail.html?right_code="+id;
				}
			},mounted(){
				this.load();
			}
		});
	</script>
	<style>
		ul li{
			list-style: none;
		}
		#lin li{
			float: left;

			margin-left:10px;

			width: 100px;

			line-height: 30px;

		}
	</style>
</html>
